import { sysKnowledgeQuery, sysKnowledgeUpdate } from "@/api/admin/courseLibrary/sysKnowledge.js";
export const SetCoverImg = {
    methods: {
        //发布确认
        setCoverImg(row) {
            let form = {
                id: row.knowledgeId,
                fileId: row.fileId,
            }
            sysKnowledgeUpdate(form).then((res) => {
                this.getKnowledgeInfo(row.knowledgeId)
                this.$message({
                    message: "操作成功",
                    type: "success",
                });
            });
        },
        getKnowledgeInfo(id) {
            sysKnowledgeQuery({ id }).then((res) => {
                this.$store.commit("SETKNOLEDGE", res.data.data[0]);
                this.getList();
            });
        }
    },
}